package com.lanchetech.dao;

import com.lanchetech.bean.request.PageReq;import com.lanchetech.bean.vo.InvoiceApplyVO;import com.lanchetech.bean.vo.InvoiceCountVO;import com.lanchetech.entity.InvoiceApply;
import org.apache.ibatis.annotations.Mapper;import org.apache.ibatis.annotations.Param;import java.util.List;

@Mapper
public interface InvoiceApplyMapper {
    int deleteByPrimaryKey(Long id);

    int insert(InvoiceApply record);

    int insertSelective(InvoiceApply record);

    InvoiceApply selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(InvoiceApply record);

    int updateByPrimaryKey(InvoiceApply record);

    InvoiceApply findOneByUserIdAndOrderId(@Param("userId") Long userId, @Param("orderId") Long orderId);

    InvoiceApply findOneByUserIdAndOrderIdAndType(@Param("userId") Long userId, @Param("orderId") Long orderId, @Param("type") Byte type);

    List<InvoiceApplyVO> findAllPage(PageReq req);

    int updateStatusAndDealTimeAndFileUrlById(InvoiceApply record);

    int updateBySerialNo(@Param("updated") InvoiceApply updated, @Param("serialNo") String serialNo);

    InvoiceCountVO countByUserIdAndStatus(@Param("userId") Long userId, @Param("status") Byte status);
}